#envelope {
  position: relative;
  width: 280px;
  height: 180px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  margin-left: auto;
  margin-right: auto;
  top: 150px;
  background-color: #7FC4CA; /* Aqua Blue */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.front {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
}

.flap {
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-bottom: 82px solid transparent;
  border-top: 98px solid #7FC4CA; /* Aqua Blue */
  transform-origin: top;
  pointer-events: none;
}

.pocket {
  border-left: 140px solid #A6D7C5; /* Mint Green */
  border-right: 140px solid #A6D7C5;
  border-bottom: 90px solid #F5B8C5; /* Pastel Pink */
  border-top: 90px solid transparent;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.letter {
  position: relative;
  background-color: #C9E5F3; /* Pale Sky Blue */
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  height: 90%;
  top: 5%;
  border-radius: 6px;
  box-shadow: 0 2px 26px rgba(0, 0, 0, 0.12);
  font-family: "Unbounded";
  padding: 15px;
  box-sizing: border-box;
}

.letter:after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.words {
  position: absolute;
  left: 10%;
  width: 80%;
  color: #1F264A; /* Deep Navy */
  font-size: 0.55rem;
  line-height: 1.6;
}

.words.riddle {
  top: 7%;
  text-align: center;
}

.open .flap {
  transform: rotateX(180deg);
  transition: transform 0.4s ease, z-index 0.6s;
  z-index: 1;
}

.close .flap {
  transform: rotateX(0deg);
  transition: transform 0.4s 0.6s ease, z-index 1s;
  z-index: 5;
}

.close .letter {
  transform: translateY(0px);
  transition: transform 0.4s ease, z-index 1s;
  z-index: 1;
}

.open .letter {
  transform: translateY(-100px);
  transition: transform 0.4s 0.6s ease, z-index 0.6s;
  z-index: 2;
}

body {
  background-color: #D7C8E7; /* Soft Lavender */
  font-family: "Unbounded", cursive;
}

.envlope-wrapper {
  height: 380px;
}

.reset {
  text-align: center;
  margin-top: 20px;
}

.reset button {
  font-weight: 800;
  font-style: normal;
  transition: all 0.1s linear;
  -webkit-appearance: none;
  background-color: transparent;
  border: solid 2px #7FC4CA;
  border-radius: 4px;
  color: #7FC4CA;
  display: inline-block;
  font-size: 14px;
  text-transform: uppercase;
  margin: 5px;
  padding: 10px;
  line-height: 1em;
  text-decoration: none;
  min-width: 120px;
  cursor: pointer;
}

.reset button:hover {
  background-color: #7FC4CA;
  color: #fff;
}

.password-section {
  text-align: center;
  margin-top: 30px;
}

.password-label {
  color: #1F264A; /* Deep Navy */
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.password-input {
  width: 200px;
  padding: 10px;
  font-size: 1rem;
  border: 2px solid #7FC4CA;
  border-radius: 5px;
  text-align: center;
  font-family: "Nunito";
  background-color: #fff;
  color: #1F264A;
  margin: 10px 0;
}

.submit-btn {
  background-color: #FFD64F; /* Golden Yellow */
  color: #1F264A;
  border: none;
  padding: 10px 30px;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: "unbounded", cursive;
  font-weight: bold;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background-color: #F6E05E; /* Warm Yellow */
  transform: scale(1.05);
}

.notification-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #D7C8E7; /* Soft Lavender */
  border: 3px solid #7FC4CA; /* Aqua Blue */
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 300px;
  text-align: center;
}

.notification-popup.show {
  display: block;
  animation: popupAppear 0.5s ease;
}

.notification-content {
  color: #1F264A; /* Deep Navy */
  font-size: 1.1rem;
  line-height: 1.8;
  white-space: pre-line;
}

.notification-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1F264A;
  margin-bottom: 15px;
}

.close-popup {
  background-color: #F5B8C5; /* Pastel Pink */
  color: #1F264A;
  border: none;
  padding: 8px 20px;
  margin-top: 15px;
  border-radius: 5px;
  cursor: pointer;
  font-family: "Dancing Script", cursive;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-popup:hover {
  background-color: #F1B38D; /* Peach */
}

@keyframes popupAppear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(31, 38, 74, 0.5);
  z-index: 999;
}

.overlay.show {
  display: block;
}
